package com.ruoyi.modularbusiness.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.modularbusiness.mapper.FormfieldSecondaryMapper;
import com.ruoyi.modularbusiness.domain.FormfieldSecondary;
import com.ruoyi.modularbusiness.service.IFormfieldSecondaryService;

/**
 * 单字段Service业务层处理
 * 
 * @author liuzhen
 * @date 2023-04-12
 */
@Service
public class FormfieldSecondaryServiceImpl implements IFormfieldSecondaryService 
{
    @Autowired
    private FormfieldSecondaryMapper formfieldSecondaryMapper;

    /**
     * 查询单字段
     * 
     * @param ffid 单字段主键
     * @return 单字段
     */
    @Override
    public FormfieldSecondary selectFormfieldSecondaryByFfid(Long ffid)
    {
        return formfieldSecondaryMapper.selectFormfieldSecondaryByFfid(ffid);
    }

    /**
     * 查询单字段列表
     * 
     * @param formfieldSecondary 单字段
     * @return 单字段
     */
    @Override
    public List<FormfieldSecondary> selectFormfieldSecondaryList(FormfieldSecondary formfieldSecondary)
    {
        return formfieldSecondaryMapper.selectFormfieldSecondaryList(formfieldSecondary);
    }

    /**
     * 新增单字段
     * 
     * @param formfieldSecondary 单字段
     * @return 结果
     */
    @Override
    public int insertFormfieldSecondary(FormfieldSecondary formfieldSecondary)
    {
        formfieldSecondary.setCreateTime(DateUtils.getNowDate());
        return formfieldSecondaryMapper.insertFormfieldSecondary(formfieldSecondary);
    }

    /**
     * 修改单字段
     * 
     * @param formfieldSecondary 单字段
     * @return 结果
     */
    @Override
    public int updateFormfieldSecondary(FormfieldSecondary formfieldSecondary)
    {
        formfieldSecondary.setUpdateTime(DateUtils.getNowDate());
        return formfieldSecondaryMapper.updateFormfieldSecondary(formfieldSecondary);
    }

    /**
     * 批量删除单字段
     * 
     * @param ffids 需要删除的单字段主键
     * @return 结果
     */
    @Override
    public int deleteFormfieldSecondaryByFfids(Long[] ffids)
    {
        return formfieldSecondaryMapper.deleteFormfieldSecondaryByFfids(ffids);
    }

    /**
     * 删除单字段信息
     * 
     * @param ffid 单字段主键
     * @return 结果
     */
    @Override
    public int deleteFormfieldSecondaryByFfid(Long ffid)
    {
        return formfieldSecondaryMapper.deleteFormfieldSecondaryByFfid(ffid);
    }
}
